package code.rocky.chapter04;

import java.text.Collator;
import java.util.Arrays;
import java.util.Locale;

public class Suggest59 {
    public static void main(String[] args) {
        String[] strs = {"张三(Z)","李四(L)","王五(W)"};
        demo01(strs);
        demo02(strs);
    }

    private static void demo02(String[] strs) {
        Arrays.sort(strs, Collator.getInstance(Locale.CHINA));
        int i = 0;
        System.out.println("=====demo02=====");
        for (String str : strs) {
            System.out.println((++i) + "、" + str);
        }
        System.out.println("=====demo02=====");
    }

    private static void demo01(String[] strs) {
        // 排序 默认升序
        Arrays.sort(strs);
        int i = 0;
        System.out.println("=====demo01=====");
        for (String str : strs) {
            System.out.println((++i) + "、" + str);
        }
        System.out.println("=====demo01=====");
    }
}
